import re

if __name__ == '__main__':
    text = "Make this **bold**. That **content show in bold** too!"

    pattern = r"(\*{2}(.*?)\*{2})"

    # results = re.findall(pattern=pattern, string=text)
    #
    # for result in results:
    #     print(result)

    # 注意：选择正确的分组
    result = re.sub(pattern=pattern, repl=r"<b>\2</b>", string=text)
    print(result)

    regular = re.compile(pattern=pattern)
    result = regular.sub(repl=r"<h1>\2</h1>", string=text)
    print(result)
